package com.fangpao.common.permission

import androidx.core.app.ActivityCompat

/**
 * ClassName: com.fangpao.common.permission
 * Description:
 * JcChen on 2022.07.14.16:20
 */
open interface PermissionCallbacks : ActivityCompat.OnRequestPermissionsResultCallback {
    fun onPermissionsGranted(requestCode: Int, perms: List<String>)
    fun onPermissionsDenied(requestCode: Int, perms: List<String>)
    fun onPermissionsAllGranted()
    fun onPermissionsHasGranted(i: Int)
}

abstract class AbsPermissionCallbacks : PermissionCallbacks {
    override fun onPermissionsHasGranted(requestCode: Int) {}
    override fun onPermissionsGranted(requestCode: Int, perms: List<String>) {}
    override fun onPermissionsDenied(requestCode: Int, perms: List<String>) {}
    override fun onPermissionsAllGranted() {}
    override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>, grantResults: IntArray) {
    }
}